from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_assets import Environment, Bundle

# 初始化扩展，但不绑定到应用
db = SQLAlchemy()
login_manager = LoginManager()
migrate = Migrate()

assets = Environment()

css = Bundle('css/style.css', filters='cssmin', output='gen/packed.css')
js = Bundle('js/script.js', filters='jsmin', output='gen/packed.js')

# 设置登录视图
login_manager.login_view = 'main.login'
login_manager.login_message = '请先登录以访问此页面'
login_manager.login_message_category = 'info' 